package com.ant.business.system.mapper;

import com.ant.business.system.entity.Module;
import com.ant.business.system.entity.RoleModule;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 角色模块管理持久层
 *
 * @author
 * @description
 * @create 2021-03-22 14:25:56
 **/
@Mapper
public interface RoleModuleDao extends BaseMapper<RoleModule> {

    @Select("select module.* " +
            " from tb_role_module roleModule " +
            " inner join tb_module module on roleModule.module_id = module.id " +
            " where roleModule.role_id = #{roleId}")
    List<Module> getRoleModuleList(@Param("roleId") int roleId);
}